package com.etime.shycourse.services.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.etime.shycourse.dao.SysbannerMapper;
import com.etime.shycourse.pojo.Sysbanner;
import com.etime.shycourse.services.interfaces.WxSysbannerServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName : WxSysbannerServicesImpl  //类名
 * @Description :   //描述
 * @Author : W //作者
 * @Date: 2022/1/5  9:22
 */
@Service
public class WxSysbannerServicesImpl implements WxSysbannerServices {
    @Autowired
    SysbannerMapper mapper;

    /**
     * 微信小程序 banner的请求接口
     *
     * @return List<Sysbanner>
     */
    @Override
    public List<Sysbanner> selectSysBannerList() {
        QueryWrapper<Sysbanner> wrapper = new QueryWrapper<> ();
        wrapper.eq ("bannerstate", 1).orderByAsc ("bannersort").last ("limit 3");
        return mapper.selectList (wrapper);
    }
}

